package work;

import java.text.MessageFormat;

import model.database;

public class checkLogin {
	public boolean isMessageCodeRight(String messageCode, String phone)
	{
		boolean result = true;
		database db = new database(
				"jdbc:mysql://localhost/gazi?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT&useSSL=false",
				"root",
				"123456");
		String  sql = MessageFormat.format("select * from {0} where messageCode=''{1}'' and phone=''{2}''", 
				"messagecode", messageCode, phone);
		String[][] res = db.select("messagecode", sql);
		if (res == null) {
			result = false;
		} else {
			result = true;
		}
		return result;
	}
	
}
